<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="docgen-resources/docgen.css" type="text/css">
  <meta name="generator" content="FreeMarker Docgen (DocBook 5)">
  <title>
    FreeMarker Manual - Basics
  </title>
    <script type="text/javascript" src="docgen-resources/jquery.js"></script>
    <script type="text/javascript" src="docgen-resources/linktargetmarker.js"></script>
</head>
<body>

    <div class="navigation">
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="pgui.html">Programmer's Guide</a>
            <b>></b>
          <a href="pgui_config.html">The Configuration</a>
            <b>></b>
          Basics
</span>    </div>
    <div class="bookmarks">
<span class="bookmarks">Bookmarks:
<a href="alphaidx.html">Alpha. index</a>, <a href="gloss.html">Glossary</a>, <a href="dgui_template_exp.html#exp_cheatsheet">Expressions</a>, <a href="ref_builtins_alphaidx.html">?builtins</a>, <a href="ref_directive_alphaidx.html">#directives</a>, <a href="ref_specvar.html">.spec_vars</a>, <a href="app_faq.html">FAQ</a>, <a href="api/index.html">API</a>, <a href="../index.html">Home</a></span>    </div>
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="pgui_config_sharedvariables.html"><span class="hideA">Next page: </span>Shared variables</a></div><div class="pagerButton"><a href="pgui_config.html">Previous page</a></div><div class="pagerButton"><a href="pgui_config.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    </div>

<div id="mainContent">

  
  
  
  
  <h1 class="rank_section1"
        id="pageTopTitle">
<a name="pgui_config_basics"></a>Basics  </h1>
    
    
<p>A configuration is an object that stores your common
        (application level) settings and defines certain variables that you
        want to be available in all templates. Also it deals with the creation
        and caching of <tt style="color: #A03D10">Template</tt> instances. A configuration
        is a <tt style="color: #A03D10">freemarker.template.Configuration</tt> instances,
        that you can create with its constructor. An application typically
        uses only a single shared <tt style="color: #A03D10">Configuration</tt>
        instance.</p><p>Configurations are used by the <tt style="color: #A03D10">Template</tt>
        methods, especially by <tt style="color: #A03D10">process</tt> method. Each
        <tt style="color: #A03D10">Template</tt> instance has exactly one
        <tt style="color: #A03D10">Configuration</tt> instance associated with it, which is
        assigned to the <tt style="color: #A03D10">Template</tt> instance by the
        <tt style="color: #A03D10">Template</tt> constructor; you can specify a
        <tt style="color: #A03D10">Configuration</tt> instance as its parameter. Usually
        you obtain <tt style="color: #A03D10">Template</tt> instances with
        <tt style="color: #A03D10">Configuration.getTemplate</tt> (not by directly calling
        the <tt style="color: #A03D10">Template</tt> constructor), in which case the
        associated <tt style="color: #A03D10">Configuration</tt> instance will be the one
        whose <tt style="color: #A03D10">getTemplate</tt> method has been called.</p>  
</div>

    <div class="navigation">
    <div class="pagers">
      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
<div class="pagerButton"><a href="pgui_config_sharedvariables.html"><span class="hideA">Next page: </span>Shared variables</a></div><div class="pagerButton"><a href="pgui_config.html">Previous page</a></div><div class="pagerButton"><a href="pgui_config.html">Parent page</a></div><div class="pagerButton"><a href="index.html">Contents</a></div>      <div class="pagersVerticalSpacer"><img src="docgen-resources/img/none.gif" width="1" height="1" alt="" hspace="0" vspace="0" border="0"/></div>
    </div>
    <div class="breadcrumb">
<span class="breadcrumb">        You are here:
          <a href="index.html">Book</a>
            <b>></b>
          <a href="pgui.html">Programmer's Guide</a>
            <b>></b>
          <a href="pgui_config.html">The Configuration</a>
            <b>></b>
          Basics
</span>    </div>
    </div>

<table border=0 cellspacing=0 cellpadding=0 width="100%">
    <tr>
      <td colspan=2><img src="docgen-resources/img/none.gif" width=1 height=8 alt=""></td>
    <tr>
      <td align="left" valign="top"><span class="smallFooter">
            FreeMarker Manual -- For FreeMarker 2.3.20
            <br>
          HTML generated: 2013-06-27 20:54:33 GMT
      </span></td>
      <td align="right" valign="top"><span class="smallFooter">
          <a href="http://www.xmlmind.com/xmleditor/">
            <img src="docgen-resources/img/xxe.gif" alt="Edited with XMLMind XML Editor">
          </a>
      </span></td>
    </tr>
</table>
  <!-- Put pre-loaded images here: -->
  <div style="display: none">
    <img src="docgen-resources/img/linktargetmarker.gif" alt="Here!" />
  </div>
</body>
</html>

